package com.carsys.service.Impl;

import com.carsys.entity.City;
import com.carsys.mapper.CityMapper;
import com.carsys.service.CarCityService;
import com.carsys.vo.VCity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CityServiceImpl implements CarCityService {
    @Autowired
    private CityMapper carMapper;
    @Override
    public List<City> findCitiesByPid(int pid) {
        return carMapper.findCitiesByPid(pid);
    }

    @Override
    public VCity findCitiy(int getid, int backid) {
        City getCity = carMapper.findByPrimaryKey(getid);
        City backCity = carMapper.findByPrimaryKey(backid);

        VCity city = new VCity();
        city.setGetCity(getCity);
        city.setBackCity(backCity);

        return city;
    }
}
